/*
 * Copyright (c) 2020-2021, Bluetrum Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2020/12/10     greedyhao    The first version
 */


#include "main.h"

static void rgb_thread_entry(void* p)
{
    RGB_Init();
    while(1)
    {
      rt_thread_mdelay(1000);
      RGB_Blue(1);
      rt_thread_mdelay(1000);
      rt_thread_mdelay(1000);
      RGB_Green(1);
      rt_thread_mdelay(1000);
      RGB_Red(1);
    }
}

static int Thread_RGB(void){
    rt_thread_t thread = RT_NULL;
    thread = rt_thread_create("rgb", rgb_thread_entry, RT_NULL, 512, 10, 10);
    if(thread == RT_NULL)
    {
        rt_kprintf("Thread_GRB Init ERROR");
        return RT_ERROR;
    }
    rt_thread_startup(thread);
}

INIT_APP_EXPORT(Thread_RGB); // 线程自动初始化

int main(void)
{
    while (1){
        rt_thread_mdelay(1000); //空延时
    };
    return 0;
}
